Microblog is a platform for sharing, spreading and acquiring information based on a user relationship. A user posts a message in Microblog, and a client generates a node for the message. The node is used to store relevant information of the message. In Microblog, the user may either forward or comment on the message corresponding to a node to acquire a child node of the node, the client sends the acquired new node to a server, and the server receives the node and stores the node by using a method for storing node.
Currently, a conventional method for storing node is specifically as follows: A storage medium is firstly divided into a memory and a file, where the memory is used to store nodes that are frequently accessed by a user; upon receiving a node from a client, a server firstly stores the received node in the file; when the user requests access to some nodes, these requested nodes are firstly searched for from the memory; and if a requested node is not stored in the memory, the requested node is searched for from the file and returned to the user, and meanwhile the acquired nodes are loaded to the memory. It should be noted that since the memory has a limited space, each time a node is loaded thereto, another node also needs to be relocated from the memory.
During the implementation of the present invention, the inventors find that the prior art has at least the following problems:
The server firstly stores received new nodes in the file. These nodes are loaded to the memory when being read by a user. If a message is very popular in Microblog, users will frequently forward or comment on the popular message in Microblog. Therefore, the node corresponding to the popular message has a large number of child nodes. When the node of the message and the large number of child nodes of the node are read, these large number of nodes will be loaded to the memory. In this case, a large number of other nodes need to be relocated from the memory. However, the nodes stored in the memory are all nodes that are frequently accessed by users. The relocated nodes may be immediately reloaded to the memory due to access by users, which still require that some nodes be relocated from the memory. In this way, a vicious circle is such formed that the frequency of loading nodes to or relocating nodes from the memory is increasing, until up to the ceiling, and performance of the server is reduced.